package com.windea.study.kotlin.jvm.crypt.sections

import com.windea.study.kotlin.jvm.crypt.extensions.*
import kotlin.test.*

class SignatureUtilsTest {
	@Test
	fun test() {
		val input = "username=Windea&password=BreezesLanding"
		val (publicKey, privateKey) = RsaCrypt.getKeyPair()
		val sign = SignatureUtils.sign(input.encodeToByteArray(), privateKey)
		println(sign.encodeBase64().decodeToString())
		val verified = SignatureUtils.verify(input.encodeToByteArray(), publicKey, sign)
		println(verified)
	}
}
